package com.niknik.woody.rest.response;

import com.niknik.woody.core.room.Room;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * User: niknik
 * Date: 1/25/11
 * Time: 8:32 PM
 */
@XmlRootElement
public class RoomDto {

  private String id;
  private String description;

  public RoomDto() {
  }

  private RoomDto(Room room) {
    this.description = room.getDescription();
    this.id = room.getId();
  }

  public static List<RoomDto> fromRooms(Collection<Room> rooms) {
    List<RoomDto> res = new ArrayList<RoomDto>(rooms.size());
    for (Room room : rooms) {
      res.add(new RoomDto(room));
    }
    return res;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }
}
